<template>
  <div class="todoItem">
    <input type="checkbox" :checked="item.isDone" @change="changeTodo({checked:$event.target.checked,id:item.id})">
    <div>{{item.text}}</div>
    <div @click="deleteTodo({id:item.id})">X</div>
  </div>
</template>

<script>
import {mapMutations} from "vuex"
  export default {
    name:"todoItem",
    props:["item"],
    methods:{
      ...mapMutations(["deleteTodo","changeTodo"])
    }
  }
</script>

<style lang="scss" scoped>
.todoItem{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>